<?php
// use App\Index;
/**
*
*/
date_default_timezone_set('PRC');
define('ROOT',dirname(__FILE__));


class A {
    private function foo() {
        echo "successasdadasd!\n";
    }
    public function test() {
        $this->foo();
        // static::foo();
    }
}

class B extends A {
   /* foo() will be copied to B, hence its scope will still be A and
    * the call be successful */
}

class C extends A {
    private function foo() {
        /* original method is replaced; the scope of the new one is C */
    }
}

// $b = new B();
/*if ($b instanceof B) {
	echo "属于B的实例";
}else{
	echo "不属于";
}*/
// $b->test();
$c = new C();
$c->test();   //fails

// 输出 hello world
// function test(){
//     $word = 'world';
//     $func = function($para)use($word){
//         echo $para ." ".$word;
//     };
//     $word = 'php';
//     return $func;
// }
// $func = test();
// $func('hello');








